<template>
	<!-- 更多选项 设置 -->
	<view>
		<view class="flex-bc moreItem" @click="handleClick(0)">
			<text>关于我们</text>
			<view class="">
				<uni-icons type="arrowright" size="14" color="#e3e3e3"></uni-icons>
			</view>
		</view>
		<view class="flex-bc moreItem" @click="handleClick(1)">
			<text>清除缓存</text>
			<view class="">
				<text class="store">0M</text>
				<uni-icons type="arrowright" size="14" color="#e3e3e3"></uni-icons>
			</view>
		</view>
		<view class="flex-bc moreItem">
			<text>当前版本</text>
			<view class="">
				<uni-icons type="arrowright" size="14" color="#e3e3e3"></uni-icons>
			</view>
		</view>
		<view class="flex-bc moreItem sujest" @click="handleClick(2)">
			<text>意见反馈</text>
			<view class="">
				<uni-icons type="arrowright" size="14" color="#e3e3e3"></uni-icons>
			</view>
		</view>
		<view class="flex-bc moreItem" @click="handleClick(3)">
			<text>帮助中心</text>
			<view class="">
				<uni-icons type="arrowright" size="14" color="#e3e3e3"></uni-icons>
			</view>
		</view>
		<view class="logout">
			<view class="flex-c btn" @click="fnLogout()">
				<text>退出登录</text>
			</view>
		</view>
		<!-- <view class="flex-c join">
			<image src="../../../static/user/join.png"></image>
			<text>我的彩站也要入驻</text>
		</view> -->
	</view>
</template>

<script>
	export default {
		data() {
			return {

			};
		},
		methods: {
			handleClick(type){
				var url
				if(type == 0){
					url = '/pages/packageB/aboutUs/aboutUs'
				}else if(type == 3){
					url = '/pages/packageB/helpCenter/helpCenter'
				}else if(type == 2){
					url = '/pages/packageB/feedback/feedback'
				}else{
					console.log('清除缓存')
				}
				if(url){
					uni.navigateTo({
						url:url
					})
				}
			},
			fnLogout() {
				var that = this
				uni.showModal({
				    content: '确定要退出登录吗？',
				    success: function (res) {
				        if (res.confirm) {
				            console.log('用户点击确定');
							uni.setStorageSync('token', '')
							that.$Store.commit('logout')
							uni.showToast({
								title: '退出登录成功',
								icon: 'success'
							})
							setTimeout(function() {
								uni.redirectTo({
									url: '../login/login'
								})
							}, 1500)
				        } else if (res.cancel) {
				            console.log('用户点击取消');
				        }
				    }
				});
			}
		}
	}
</script>

<style lang="scss" scoped>
	.moreItem{
		height: 100rpx;
		background: #fff;
		padding: 0 20rpx;
		font-size: 30rpx;
		border-bottom: 1rpx solid #f5f5f5;
		.store{
			font-size: 26rpx;
			color: #666;
			margin-right: 10rpx;
		}
	}
	.sujest{
		margin-top: 20rpx;
	}
	.logout{
		padding: 40rpx 40rpx;
		background: #fff;
		.btn{
			width: 100%;
			height: 88rpx;
			background: #F22F29;
			border-radius: 10rpx;
			color: #fff;
			font-size: 30rpx;
		}
	}
	.join{
		font-size: 30rpx;
		margin-top: 40rpx;
		color: #07cdac;
		image{
			width: 36rpx;
			height: 36rpx;
			margin-right: 10rpx;
		}
	}
</style>
